home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK2.toast / Development Kits / TEC 1.4 / SampleCode / DropEncoder / Headers / CustomApp.h next >
Encoding:
C/C++ Source or Header  |  1998-09-25  |  3.4 KB  |  109 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************
  2. #
  3. #    CustomApp.h
  4. #    
  5. #   This is a simple application shell that we use to handle the standard mac stuff.
  6. #   In general, the routines in this code should be as generic as possible, and any
  7. #   custom code should be included in CustomApp.c instead.  See CustomApp.h for a list
  8. #   of the routines that need to be provided by the custom application.
  9. #   
  10. #   Shell.h also includes all the debugging macros and application conditionals, so
  11. #   is should be included by all project files.
  12. #
  13. #    Author: Timothy Carroll
  14. #    Apple Developer Technical Support
  15. #    timc@apple.com
  16. #
  17. #    Revision: Jason Yeo
  18. #
  19. #    Modification History: 
  20. #
  21. #    2/9/97        TMC     Initial Release
  22. #
  23. #    9/12/97        JY         Updated for:
  24. #                        TEC 1.2.1 
  25. #                        Universal Interfaces 3.0
  26. #                        CodeWarrior 11 projects
  27. #
  28. #    Copyright © 1997 Apple Computer, Inc., All Rights Reserved
  29. #
  30. #
  31. #    You may incorporate this sample code into your applications without
  32. #    restriction, though the sample code has been provided "AS IS" and the
  33. #    responsibility for its operation is 100% yours.  However, what you are
  34. #    not permitted to do is to redistribute the source as "DSC Sample Code"
  35. #    after having made changes. If you're going to re-distribute the source,
  36. #    we require that you make it clear in the source that the code was
  37. #    descended from Apple Sample Code, but that you've made changes.
  38. #
  39. *************************************************************************************/
  40.  
  41. #ifndef __CUSTOMAPP__
  42. #define __CUSTOMAPP__
  43.  
  44. #pragma once
  45.  
  46. #include "Shell.h"
  47.  
  48. /*************************************************************************************
  49. #    REQUIRED CONSTANTS
  50. #
  51. #    The Shell uses these to customize the application's behavior.
  52. *************************************************************************************/
  53.     
  54. // We'll use these constants to tailor the Application's behavior.
  55.  
  56. enum
  57. {
  58.     kEventInterval = 3,            // How often to check for events
  59.     kNumberOfMasters = 10,        // # of initial MoreMaster calls to make
  60.     kSleepTime = 15                // How much time we'll give when in the background.
  61. };
  62.  
  63.  
  64. // Menu constants
  65.  
  66. // Constants for the various menu items
  67. enum
  68. {
  69.     rMenuBar = 128,
  70.     mAppleMenu = 128,
  71.         iAboutApp = 1,
  72.     mFileMenu = 129,
  73.         iConvert = 1,
  74.         iQuit = 3,
  75.     mEditMenu = 130,
  76.         iUndo = 1,
  77.         iCut = 3,
  78.         iCopy = 4,
  79.         iPaste = 5,
  80.         iClear = 6,
  81.         iSelectAll = 8,
  82.         iPreferences = 10
  83.  
  84. };
  85.  
  86.  
  87.  
  88.  
  89. /*************************************************************************************
  90. #    REQUIRED APPLICATION ROUTINES
  91. #
  92. #    All of these routines are required.  The Shell portion calls these routines to
  93. #   handle various events, such as initializing the app, handling Apple events, and
  94. #   termination ofthe app.
  95. *************************************************************************************/
  96. OSStatus InitApp (void);
  97. OSStatus TerminateApp (void);
  98.  
  99. Boolean AppWantsTime (void);    // Should return true if the app wants idle time between events
  100. OSStatus TimeSlice (void);        // This routine is called when the app wants idle time
  101.  
  102. OSStatus HandleEvent (EventRecord *theEvent);
  103.  
  104. pascal OSErr HandleOpenAppEvent (AppleEvent *event, AppleEvent *reply,long refCon);
  105. pascal OSErr HandleOpenDocEvent (AppleEvent *event, AppleEvent *reply,long refCon);
  106. pascal OSErr HandlePrintDocEvent (AppleEvent *event, AppleEvent *reply,long refCon);
  107. pascal OSErr HandleQuitAppEvent (AppleEvent *event, AppleEvent *reply,long refCon);
  108.  
  109. #endif // __CUSTOMAPP__